﻿package net.jmp0.toast.entities.effects 
{
	import net.jmp0.toast.entities.bases.GameButton;
	import punk.core.Spritemap;
	
	/**
	 * ...
	 * @author Thodd
	 */
	public class NextLevelButton extends GameButton	{
		
		public var nextText:GameText = new GameText("let's go!", 200, 120, "garbage", 50, -351, true);
		
		//Marker sprites
		[Embed(source = '../../res/marker/marker_green.png')] private var imgGreenMarker:Class;
		private var sprGreenMarker:Spritemap = FP.getSprite(imgGreenMarker, 181, 36, false, false, 0, 0, true);
		
		
		public function NextLevelButton(x:int, y:int, callback:Function){
			super(x, y, callback);
			
			nextText.x = x+20;
			nextText.y = y - 20;
			FP.world.add(nextText);
			
			this.sprite = sprGreenMarker;
			this.alpha = 0.7;
		}
		
		
		override public function update():void {
			super.update();
			
			if (mouseIsOverMe) {
				visible = true;
			}else {
				visible = false;
			}

		}
		
		override public function destroy():void {
			nextText.destroy();
			super.destroy();
		}
		
	}

}